#!/usr/bin/env bash

set -euvo pipefail

# Optional - only used for print_colorized
source anchore-ci/utils

hash anchore-cli || python -m pip install -q anchorecli

print_colorized INFO "Running Anchore Engine end-to-end tests."; echo

anchore-cli --u admin --p foobar system wait --timeout 300 --interval 10 --feedsready '' --servicesready 'catalog,apiext,policy_engine,simplequeue,analyzer'
anchore-cli --u admin --p foobar --url http://localhost:8228/v1 system status

python scripts/tests/aetest.py docker.io/alpine:latest
python scripts/tests/aefailtest.py docker.io/alpine:latest

print_colorized INFO "Finished running Anchore Engine end-to-end tests."; echo
